package FTPDown;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

import javax.print.attribute.standard.Finishings;

public class FTPServer {
    public static void main(String[] args) throws Exception{
    	ServerSocket server=new ServerSocket(5555);
    	Socket  socket=server.accept();
    	InputStream fin=new FileInputStream("FileText/14.jpg");
    	OutputStream nout=socket. getOutputStream();
    	byte[] buffer=new byte[256];
    	int len=0;
    	while((len=fin.read(buffer))!=-1){
    		nout.write(buffer,0,len);
    	}
    	nout.close();
    	
    }
}
